package com.xsir.dto;

import com.xsir.entity.User;
import lombok.*;

/**
 * @author xsir
 * @date 2020/11/5
 */
@Setter
@Getter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class Author {
    /**
     * 姓名
     */
    private String name;
    /**
     * 头像
     */
    private String avatar;
    /**
     * 座右铭
     */
    private String motto;
    /**
     * 发布的文章数
     */
    private Integer essays = 0;
    /**
     * 发表的评论数
     */
    private Integer comments = 0;
    /**
     * 收藏的文章数
     */
    private Integer collections = 0;
    
    public Author(User user) {
        name = user.getUsername();
        avatar = user.getAvatar();
        motto = user.getMotto();
    }
}
